<?php

use yii\helpers\Html;
use yii\bootstrap\ActiveForm;

/* @var $this yii\web\View */
/* @var $form yii\bootstrap\ActiveForm */
/* @var $model app\models\LoginForm */

$this->title = '注册';
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="row" style="margin-top:20px">
    <div class="col-xs-12 col-sm-8 col-md-6 col-sm-offset-2 col-md-offset-3">
        <?php
        $form = ActiveForm::begin([
                    'id' => 'register-form',
                    'options' => [],
                    'fieldConfig' => [
                        'template' => "{label}\n{input}\n<div class=\"col-lg-12\">{error}</div>",
                    ],
        ]);
        ?>
        <fieldset>
            <h2><?php echo Html::encode($this->title) ?></h2>
            <hr class="colorgraph">
            <div class="form-group">
                <?php echo $form->field($model, 'username')->textInput(['class' => 'form-control input-lg', 'placeholder' => '用户名'])->label(FALSE); ?>
            </div>
            <div class="form-group">
                <?php echo $form->field($model, 'email')->textInput(['class' => 'form-control input-lg', 'placeholder' => '邮箱'])->label(FALSE); ?>
            </div>
            <div class="form-group">
                <?php echo $form->field($model, 'password')->passwordInput(['class' => 'form-control input-lg', 'placeholder' => '密码'])->label(FALSE) ?>
            </div>
            <div class="form-group">
                <?php echo $form->field($model, 'password_confirm')->passwordInput(['class' => 'form-control input-lg', 'placeholder' => '重复输入密码'])->label(FALSE) ?>
            </div>

            <hr class="colorgraph">
            <div class="row">
                <div class="col-xs-6 col-sm-6 col-md-6">
                    <?php echo Html::submitButton('注册', ['class' => 'btn btn-lg btn-success btn-block', 'name' => 'login-button']) ?>
                </div>
                <div class="col-xs-6 col-sm-6 col-md-6">
                    <a href="/user/login" class="btn btn-lg btn-primary btn-block">登陆</a>
                </div>
            </div>
        </fieldset>
        <?php ActiveForm::end(); ?>
    </div>
</div>